package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.RemoteAnnounceService;
import com.ruoyi.system.api.RemoteDeptService;

import com.ruoyi.system.api.domain.SwglAnnouncement;
import com.ruoyi.system.api.domain.SysDept;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @author nansonghao
 * @description 部门管理服务降级
 * @date 2022/7/13
 */
public class RemoteAnnounceFallbackFactory implements FallbackFactory<RemoteAnnounceService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteAnnounceFallbackFactory.class);

    @Override
    public RemoteAnnounceService create(Throwable throwable) {
        log.error("公告新增服务调用失败:{}", throwable.getMessage());
        return new RemoteAnnounceService() {
            @Override
            public AjaxResult add(SwglAnnouncement swglAnnouncement) {
                return null;
            }
        };
    }
}
